<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>表单加密测试</title>
<!--    MD5工具类-->
    <script src="https://cdn.bootcss.com/blueimp-md5/2.10.0/js/md5.min.js"></script>
</head>
<body>
    <form action="https://www.baidu.com/" method="post" onclick="aaa()">
        <span>用户名</span><input type="text"  id="username"  name="username" ><br>
        <span>密码</span> <input type="password" id="input-password" ><br>
        <input type="hidden" id="md5-password" name="password">
        <button type="submit">提交</button>
    </form>
    <script>
        function aaa() {
            let uname = document.getElementById("username")
            let pwd = document.getElementById("input-password")
            let md5pwd = document.getElementById("md5-password")
            md5pwd.value = md5(pwd.value)
            return true
        }
    </script>

</body>
</html>